﻿using System;
using TextEditor.TextDocument.Control;

namespace TextEditor
{
   

    public class A_SetPageMargins : A_Action
    {
        public override string ActionName()
        {
            return "setpagemargins";
        }

        public override bool Execute()
        {
            //base.myOwnerDocument.Pages.SetPageMargins(Convert.ToInt32(base.Param1), Convert.ToInt32(base.Param2), Convert.ToInt32(base.Param3), Convert.ToInt32(base.Param4));
            //base.myOwnerDocument.UpdateViewSize();
            //base.myOwnerDocument.RefreshLine();
            //base.myOwnerDocument.UpdateView();
            using (frmSetPage page = new frmSetPage(this.OwnerDocument))
            {
                if (page.ShowDialog()== System.Windows.Forms.DialogResult.OK)
                {
                    this.OwnerDocument.RefreshSize();
                    this.OwnerDocument.ContentChanged();
                }
            }

            return true;
        }

        public override bool isEnable()
        {
            return base.myOwnerDocument.CanModify();
        }
    }
}

